package com.htpro.controller;

import com.htpro.pojo.Plan;
import com.htpro.pojo.Seat;
import com.htpro.pojo.Typef;
import com.htpro.service.SeatService;
import com.htpro.service.TypefService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@CrossOrigin
@RestController
public class SeatController {
    @Autowired
    private SeatService Ss;
    @GetMapping("/seat/{fid}/{cid}")
    public List<Seat> cinemaByFilm(@PathVariable("fid") Integer id,@PathVariable("cid") Integer cid){
        List<Seat> list = Ss.getSeatbyfid(id,cid);
        return list;
    }
    @GetMapping("/updateseat1/{no}/{pid}")
    public int updateseat1(@PathVariable("no") Integer no,@PathVariable("pid") Integer pid){
        int n = Ss.updateSeat1(no,pid);
        return n;
    }
    @GetMapping("/updateseat0/{no}/{pid}")
    public int updateseat0(@PathVariable("no") Integer no,@PathVariable("pid") Integer pid){
        int n = Ss.updateSeat0(no,pid);
        return n;
    }
    @GetMapping("/updateseat2")
    public int updateseat2(){
        int n = Ss.updateSeat2();
        return n;
    }
}
